[IOS SDK] retrieving scores from game center

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2011-01-16T03:48:26Z Indexed on 2011/01/16 3:53 UTC
Read the original article Hit count: 409

Filed under:
|
|
|

I got this code from apple's developer site. How do i process the score information to be viewed in a like a UITableView or something?

  • (void) retrieveTopTenScores { GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init]; if (leaderboardRequest != nil) { leaderboardRequest.playerScope = GKLeaderboardPlayerScopeGlobal; leaderboardRequest.timeScope = GKLeaderboardTimeScopeAllTime; leaderboardRequest.range = NSMakeRange(1,10); [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error) { if (error != nil) { // handle the error. } if (scores != nil) { // process the score information. } }]; } }

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ipad